<mat-table [dataSource]="dataSource" data-automation-id="input-mapping-table">
    <ng-container matColumnDef="name">
        <mat-header-cell data-automation-id="table-header-cell-name" *matHeaderCellDef [ngClass]="'input-mapping'">
            {{ parameterColumnHeader | translate }}</mat-header-cell>
        <mat-cell *matCellDef="let parameter"
            matTooltip="{{ parameter.description + ' (type: ' + parameter.type + ')' }}" matTooltipPosition="before"
            matTooltipShowDelay="1000" [attr.data-automation-id]="'param-id-' + parameter.id">
            <span>
                {{ parameter.label || parameter.name }}
                <span class="required-parameter" *ngIf="parameter.required">*</span>
            </span>
        </mat-cell>
    </ng-container>
    <ng-container matColumnDef="process-variable">
        <mat-header-cell data-automation-id="table-header-cell-process-variables" *matHeaderCellDef [ngClass]="'input-mapping'">
            {{ variableColumnHeader | translate }} /
            {{ 'SDK.VARIABLE_MAPPING.VALUE' | translate }}
        </mat-header-cell>
        <mat-cell *matCellDef="let parameter; let i = index">
            <div *ngIf="mappingTypes[parameter.name] === VALUE_TYPE"
                class="modelingsdk-input-mapping-table-mapped-value-div ellipsis-cell">
                <span [attr.data-automation-id]="'value-input-' + parameter.id"
                    class="input-mapping-table-mapped-value-div-value variable-value-type-value ">{{values[parameter.name] | variablevalue}}</span>
            </div>
            <ng-container *ngIf="mappingTypes[parameter.name] === VARIABLE_TYPE">
                <mat-select *ngIf="isThereOptionForParam(parameter); else noProcessPropertiesTmpl"
                    placeholder="{{ variableColumnHeader | translate }}"
                    (selectionChange)="selectVariable($event.value, parameter)" [compareWith]="compareWith"
                    [(ngModel)]="paramName2VariableName[parameter.name]"
                    [value]="paramName2VariableName[parameter.name]"
                    [attr.data-automation-id]="'variable-selector-' + parameter.id" [ngClass]="'input-mapping'">
                    <mat-option *ngFor="let property of optionsForParams[parameter.name]" [value]="property">
                        {{ property.name }}
                    </mat-option>
                </mat-select>
            </ng-container>
            <mat-icon (click)="edit(i)" class="modelingsdk-input-mapping-table__mapping-icon adf-textitem-action" [attr.data-automation-id]="'edit-value-mapping-' + parameter.id">
                edit
            </mat-icon>
        </mat-cell>
    </ng-container>
    <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
    <mat-row *matRowDef="let row; columns: displayedColumns; let i = index;"></mat-row>
</mat-table>

<ng-template #noProcessPropertiesTmpl>
    <span class="no-process-properties-msg">{{ 'SDK.VARIABLE_MAPPING.NO_PROCESS_PROPERTIES' | translate }}</span>
</ng-template>
